<template>
	<view class="page__bd">
		<hb-overlay :show="show" @click="onClickHide" />
		<view class="hb-bar bg-white solid-bottom">
			<view class="action">
				<text class="hb-icon_title text-blue"></text>
				基础用法
			</view>
		</view>
		<view class="bg-white padding">
			<button class="hb-btn hb-btn_success" @click="onClickShow">显示遮罩层</button>
		</view>
		<hb-overlay :show="showEmbedded" @click="onClickHideEmbedded">
			<view class="wrapper">
				<view class="block" @tap="noop">嵌入内容</view>
			</view>
		</hb-overlay>
		<view class="hb-bar bg-white solid-bottom">
			<view class="action">
				<text class="hb-icon_title text-blue"></text>
				嵌入内容
			</view>
		</view>
		<view class="bg-white padding">
			<button class="hb-btn hb-btn_success" @click="onClickShowEmbedded">嵌入内容</button>
		</view>
	</view>
</template>

<script>
	import hbOverlay from '@/components/hb-overlay/index';
	export default {
		components: {
			hbOverlay
		},
		data() {
			return {
				show: false,
				showEmbedded: false
			}
		},
		methods: {
			onClickShow() {
				this.show = true
			},
			onClickHide() {
				this.show = !this.show
			},
			onClickShowEmbedded() {
				this.showEmbedded = true;
			},
			onClickHideEmbedded() {
				this.showEmbedded = !this.showEmbedded
			},
			noop() {}
		}
	}
</script>

<style>
	.wrapper {
		display: flex;
		align-items: center;
		justify-content: center;
		height: 100%;
	}

	.block {
		width: 120px;
		height: 120px;
		background-color: #fff;
	}
</style>
